//app.js
var uma = require('./utils/uma.min');
App({
  onLaunch: function () {
    // 登录
    qq.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
		console.log(res.code);
/* 		qq.request({
		  url: this.globalData.API_ROOT+'auth/openuser/1110696015/statis', // 仅为示例，并非真实的接口地址
		  data: {
		    code: res.code,
		    platform: 'QQ'
		  },
		  method:'POST',
		  header: {
		    'content-type': 'application/json' // 默认值
		  },
		  success(res) {
		    console.log(res)
			qq.uma.setOpenid(res.openId);
		  }
		}) */
      }
    })

  },
  umengConfig: {
      appKey: '5f4615f8f9d1496ef41927ac', // 由友盟分配的APP_KEY
      useOpenid: true,
      autoGetOpenid: true,
      debug: true, // 是否打开调试模式
      uploadUserInfo: true // 自动上传用户信息，设为false取消上传，默认为false
    },
  globalData: {
    userInfo: null,
	userId:'0',
	token: '',
	isLogin: false,
	appid:'1110696015',//必填
	//API_ROOT: 'http://192.168.2.54:8080/',
  //API_ROOT: 'http://localhost:8080/',
  API_ROOT: 'https://carpool.ld9527.com/',
  }
})
